import request from '@/utils/request'
import data from "@/views/system/dict/data.vue";

//查询产品列表
export function listProduct(query){
  return request({
    url: '/system/product/listProduct',
    method: 'get',
    params: query
    }
  )
}
//查询分类名称
export function getCategoryName(query){
  return request({
    url: '/system/category/getCategoryArray',
    method: 'get',
    params: query
  })
}
//搜索产品列表
export function searchProduct(query){
  return request({
    url: '/system/product/search',
    method: 'get',
    params: query
  })
}

// 查询岗位详细
export function getPost(postId) {
  return request({
    url: '/system/post/' + postId,
    method: 'get'
  })
}

//查询产品详情
export function getProduct(id){
  return request({
    url: '/system/product/getProduct/' + id,
    method: 'get'
  })
}

//新增产品
export function addProduct(date){
  return request({
    url: '/system/product/create',
    method: 'post',
    data: date
  })
}

//修改岗位
export function updateProduct(data){
  return request({
    url: '/system/product/update',
    method: 'post',
    data: data
  })
}

//删除产品
export function deleteProduct(data){
  return request({
    url: '/system/product/removeStatus',
    method: 'post',
    data: data
  })
}
// 删除岗位
export function delPost(postId) {
  return request({
    url: '/system/post/' + postId,
    method: 'delete'
  })
}
